import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import './mock'
import './api/data.js'

import './registerServiceWorker'
import './plugins/vant.js'
import './assets/css/reset.css'
import './assets/css/global.css'

Vue.config.productionTip = false

//登录验证
//  router.beforeEach((to, from, next)=>{
//    let isValidLogin = store.state.user.isValidLogin;
//    console.log('beforeEach', isValidLogin);

//     if(isValidLogin){
//       next();
//     } else {
//       console.log(`from.path: ${from.path}`)
//       console.log(`to.path: ${to.path}`)
//       if (from.path !== '/login') {
//         next({
//           name: 'Login'
//         });
//       } else {
//         next(false);
//       }
//     }
//  });

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
